FROM apache/flink:1.13.2-scala_2.12

COPY hadoop-2.10.1 /opt/hadoop-2.10.1
copy docker-entrypoint.sh /docker-entrypoint.sh
COPY flink-shaded-hadoop-2-uber-2.8.3-10.0.jar /opt/flink/lib
RUN ln -s /opt/hadoop-2.10.1 /opt/hadoop && \
    chmod +x /docker-entrypoint.sh
ENV HADOOP_HOME=/opt/hadoop
ENV HADOOP_CLASSPATH="/opt/hadoop/etc/hadoop:/opt/hadoop/share/hadoop/common/lib/*:/opt/hadoop/share/hadoop/common/*:/opt/hadoop/share/hadoop/hdfs:/opt/hadoop/share/hadoop/hdfs/lib/*:/opt/hadoop/share/hadoop/hdfs/*:/opt/hadoop/share/hadoop/yarn/lib/*:/opt/hadoop/share/hadoop/yarn/*:/opt/hadoop/share/hadoop/mapreduce/lib/*:/opt/hadoop/share/hadoop/mapreduce/*:/opt/hadoop/contrib/capacity-scheduler/*.jar"
ENV PATH=/opt/hadoop/bin:/opt/flink/bin:/usr/local/openjdk-8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
COPY kubernetes-jobmanager.sh /opt/flink/bin
COPY kubernetes-taskmanager.sh /opt/flink/bin
